#include<iostream>
using namespace std;
class CVector {
private:
	int* data;
	int n;
public:
	CVector();
	void print();
	CVector(int n1, int* a);
	friend CVector add(const CVector v1, const CVector v2);
	CVector(CVector& c)
	{
		this->n = c.n;
		data = new int[n];
		for (int i = 0; i < n; i++)
		{
			data[i] = c.data[i];
		}
	}
	~CVector();
};
CVector::CVector() {
	n = 5;
	data = new int[n];
	for (int i = 0; i < n; i++) {
		data[i] = i;
	}
}
CVector::CVector(int n1, int* a) {
	n = n1;
	data = new int[n];
	for (int i = 0; i < n; i++) {
		data[i] = a[i];
	}
}
void CVector::print() {
	for (int i = 0; i < n; i++) {
		if (i == n - 1) {
			cout << data[i] << endl;
		}
		else {
			cout << data[i] << ' ';
		}
	}
}
CVector add(const CVector v1, const CVector v2) {
	int* a = new int[v1.n];
	for (int i = 0; i < v1.n; i++)
	{
		a[i] = v1.data[i] + v2.data[i];
	}
	CVector C(v1.n, a);
	return C;
}
CVector::~CVector() {
	delete[] data;
}
int main()
{
	int t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		int n;
		cin >> n;
		int* arr1 = new int[n];
		for (int j = 0; j < n; j++) {
			cin >> arr1[j];
		}
		int* arr2 = new int[n];
		for (int j = 0; j < n; j++) {
			cin >> arr2[j];
		}
		CVector C1(n, arr1);
		C1.print();
		CVector C2(n, arr2);
		C2.print();
		add(C1, C2).print();
	}
	return 0;
}